If you read a book where there is a speaking snake; you know immediately that the story is myth or magic. If you are a young child you might expect stories to be like this... but for an adult it usually registers as some sort of fairy tale. If you think otherwise...think again or get a proper education.
So the flood story in the Bible is entirely in the spirit of a myth since the events tell of a physically impossible event (there was not enough water to cover the highest mountains) and this is not surprising since the story was borrowed, like most of the Biblical “sacred writings” from much older mythology, in this case from the earliest writings known to mankind, from Mesopotamia where writing was first developed and can therefore be called the beginning of the “historic period” as opposed to pre-history.
What the flood myths encapsulate is the re-working of a prehistoric folk memory of climate change.
There was indeed a time when rain was scarce during the last ice age which ended as recently as 12,000 years ago. The arctic cold spell had peaked around eighteen thousand years before the present when much of the Northern hemisphere was covered in ice. In Europe that meant glaciers coming as far south as the British Isles and tundra or steppe conditions down to the shores of the Mediterranean with woolly mammoth, woolly rhinoceros and reindeer flourishing in those regions which were characterised by a particular low and sparse vegetation (called mammoth steppe).
This climate situation recurs over geological time and has done so for about twenty times in the last 2.3 million years. The key features are the tremendous drop in sea water levels and a corresponding colossal build up of Arctic and Antarctic ice during the coldest periods. This meant that in the latitudes just south of the Mediterranean there was hardly any rainfall with most of the free moisture bound up in the ice. In fact lakes were significantly higher where it was not frozen and indeed a mist or dew watered the plants as it does today in places like Namibia or at the driest place on Earth in the Atacama Desert in northern Chile. At that time, as the archeology and earth- scientists record that the Sahara was greener then, not everywhere was dry. As evidence of cold resulting in drought; look at the Arctic today which remains a dry desert.
The flood myths generally and there are very many of them, as in the Genesis account do contrast the former drought with the later deluge. So the melting of the ice caps at the end of the ice age, over a period of some four thousand years created a “pluvial” episode or ultra rainy period which would induce many localised floods.
Of course the Bible uses “stories” often greatly embellished or exaggerated to teach morality lessons such as if you do not worship God you will be punished... and basically that is why the borrowed flood myth was used by the Hebrews in Genesis.